import User from './User'
import { version } from '../package.json';

class JSAuthenticationSdk {
    constructor() {
        // TODO
    }

    login({ username, password }) {
        if (username && username === password) {
            return User.of({ username, password })
        } else {
            throw new Error('username or password error')
        }
    }

    register({ username, password }) {
        if (username && username === password) {
            return User.of({ username, password })
        } else {
            throw new Error('params error')
        }
    }

    static version = version;
}

export default JSAuthenticationSdk;